import request from '@/utils/axios'
// 用户登录
export function login(data) {
  return request({
    url: '/api/login',
    method: 'post',
    data,
    config: {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
      },
      timeout: 10000
    }
  })
}
export function guestLogin(data) {
  return request({
    url: '/api/guest/login',
    method: 'post',
    data,
    config: {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
      },
      timeout: 10000
    }
  })
}

// 获取用户角色
export function getUserInfo(data) {
  return request({
    url: '/api/getUserInfo',
    method: 'get',
    config: {
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      timeout: 10000
    },
    data
  })
}
export function getGuestUserInfo(data) {
  return request({
    url: '/api/guest/getUserInfo',
    method: 'get',
    config: {
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      timeout: 10000
    },
    data
  })
}
